package com.fh.service.me;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.system.User;
import com.fh.util.PageData;

/** 
 *
 * @author 王利慧
 * @datetime 2017-3-30 上午11:17:47
 * @editnote 
 *	
 */
@Service("supplierUserService")
public class SupplierUserService {
	@Resource(name="daoSupport")
	private DaoSupport dao;
	//查看基本资料
	public PageData findUserById(PageData pd) throws Exception {
		return (PageData) dao.findForObject("SupplierUserMapper.findUserById", pd);
	}
	//修改资料
	public int updateUserByUId(PageData pd) throws Exception {
		return (Integer) dao.update("SupplierUserMapper.updateUserInformation", pd);
	}
	
	//判断邮箱是否存在
	public PageData getUserByEmail(PageData pd) throws Exception {
		return (PageData) dao.findForObject("SupplierUserMapper.findByUE", pd);
	}
	//确认注册添加用户
	public int addUser(PageData pd) throws Exception {
		return (Integer) dao.save("SupplierUserMapper.addUser", pd);
	}
	//添加到从表
	public int addSupplier(PageData pd) throws Exception {
		return (Integer) dao.save("SupplierUserMapper.addSupplier", pd);
	}
	
	//确认修改密码
	public int updatePass(PageData pd) throws Exception {
		return (Integer) dao.update("SupplierUserMapper.updatePass",pd);
	}
	//申请供应商
	public User findSupplier(PageData pd) throws Exception {
		return (User) dao.findForObject("SupplierUserMapper.updatePass", pd);
	}
	
}
